﻿using System;
using Sinacor.Servico.Bovespa.Cliente.BusinessEntity;
using Sinacor.Servico.Bovespa.Custodia.Service.DataContract.Request;


namespace Sinacor.Servico.Bovespa.Custodia.Service.ServiceImplementation.Translator
{
    public static class TranslateBetweenClienteAndConsultarPosicaoCustodiaRequest
    {
        public static Sinacor.Servico.Bovespa.Cliente.BusinessEntity.Cliente TranslateConsultarPosicaoCustodiaRequestToCliente(Sinacor.Servico.Bovespa.Custodia.Service.DataContract.Request.ConsultarPosicaoCustodiaRequest from)
        {
            if (from == null) return null;

            Sinacor.Servico.Bovespa.Cliente.BusinessEntity.Cliente to = new Sinacor.Servico.Bovespa.Cliente.BusinessEntity.Cliente();
            to.Codigo = from.CodigoCliente;
            to.Apelido = from.Apelido;
            return to;
        }

        public static Sinacor.Servico.Bovespa.Custodia.Service.DataContract.Request.ConsultarPosicaoCustodiaRequest TranslateClienteToConsultarPosicaoCustodiaRequest(Sinacor.Servico.Bovespa.Cliente.BusinessEntity.Cliente from)
        {
            if (from == null) return null;

            Sinacor.Servico.Bovespa.Custodia.Service.DataContract.Request.ConsultarPosicaoCustodiaRequest to = new Sinacor.Servico.Bovespa.Custodia.Service.DataContract.Request.ConsultarPosicaoCustodiaRequest();
            to.CodigoCliente = from.Codigo;
            to.Apelido = from.Apelido;
            return to;
        }
    }
}
